<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>创新创业教师管理系统</title>
	<link rel="stylesheet" type="text/css" href="style/all.css">
	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="js/main.js"></script>
	<!-- 日期插件 -->
	<script type="text/javascript" src="plug/laydate/laydate.js"></script>
	<!-- 字体图标 -->
	<script src="plug/font/iconfont.js"></script>
</head>
<body class="bg_i">
	<!-- 顶部 -->
	<div class="header">
		<div class="head">
			<img src="./images/school.jpg" alt="logo">
			<span class="logo">创新创业教师管理系统</span>
			<div class="nav">
				<a href="javascrpt:;" class="home">
					<svg class="icon" aria-hidden="true">
						<use xlink:href="#icon-riqi"></use>
					</svg>
					2017.09.01
				</a>
				<div class="home email">
					<svg class="icon" aria-hidden="true">
						<use xlink:href="#icon-seeusero"></use>
					</svg>
					<span>王老师</span>
					<div class="e_list">
						<div class="tran"></div>
						<div class="tran_g"></div>
						<ul>
							<li><a href="user_T.html">修改密码</a></li>
							<li><a href="javascript:;">清除缓存</a></li>
							<li><a href="login.html">退出</a></li>
						</ul>
					</div>
				</div>
				<!-- 邮件 -->
				<div class="home email">
					<svg class="icon" aria-hidden="true">
						<use xlink:href="#icon-email"></use>
					</svg>
					<span class="num">2</span>
					<div class="e_list">
						<div class="tran"></div>
						<div class="tran_g"></div>
						<ul>
							<li><a href="index_T.html">与我相关</a></li>
						</ul>
					</div>
				</div>
				<a href="login.html" class="home email">
					<svg class="icon" aria-hidden="true">
						<use xlink:href="#icon-tuichu-copy"></use>
					</svg>
					<span>退出</span>
				</a>
			</div>
		</div>
	</div>
	<!-- 主体 -->
	<div class="container_i">
		<!-- 左边侧边栏 -->
		<div class="left">
			<div class="navbox">
				<div class="title">菜单中心</div>
				<ul class="nav">
					<li><a href="student_item_T.html" class="hover">个人信息</a></li>
					<li><a href="index_T.html">通知消息</a></li>
					<li><a href="creation_info_T.html">创业信息</a></li>
					<li><a href="item_manage_T.html">项目管理</a></li>
					<li><a href="user_T.html">用户管理</a></li>
					<li><a href="login.html">退出</a></li>
				</ul>
			</div>
		</div>
		<!-- 右边侧边栏 -->
		<div class="right">
			<!-- 个人信息部分 -->
			<div class="item">
				<div class="btn">
					<span class="span_t">个人信息表</span>
					<a href="print_p_T.html" class="print">打印</a>
					<button class="change">修改</button>
					<button class="sure">确认</button>
					<div class="clear"></div>
				</div>
				<table border="1" id="com">
					<tr>
						<td class="one">姓名<span class="need">*</span></td>
						<td class="two"><input type="text" value="王小茗"></td>
						<td class="one">年龄<span class="need">*</span></td>
						<td class="two"><input type="text" value="40"></td>
						<td class="one">性别<span class="need">*</span></td>
						<td class="two">
							<label for="man"><input type="radio" name="sex" id="man">男</label>
							<label for="woman"><input type="radio" checked="" name="sex" id="woman">女</label>
						</td>
					</tr>
					<tr>
						<td class="one">出生日期<span class="need">*</span></td>
						<td class="two"><input type="text" value="2017-08-31" id="datepicker"></td>
						<td class="one">政治面貌<span class="need">*</span></td>
						<td class="two"><input type="text" value="党员"></td>
						<td class="one">民族<span class="need">*</span></td>
						<td class="two"><input type="text" value="汉族"></td>
					</tr>
					<tr>
						<td class="one">学历<span class="need">*</span></td>
						<td class="two"><input type="text" value="硕士"></td>
						<td class="one">学位<span class="need">*</span></td>
						<td class="two"><input type="text" value="硕士"></td>
						<td class="one">导师类型<span class="need">*</span></td>
						<td class="two"><input type="text" value="创业导师"></td>
					</tr>
					<tr>
						<td class="one">工号</td>
						<td class="two"><input type="text" value="11014410101"></td>
						<td class="one">手机<span class="need">*</span></td>
						<td class="two"><input type="text" value="1234567890"></td>
						<td class="one">邮箱<span class="need">*</span></td>
						<td class="two"><input type="text" value="1234567890@qq.com"></td>
					</tr>
					<tr>
						<td class="one">职称<span class="need">*</span></td>
						<td class="two"><input type="text" value="计算机管理主任"></td>
						<td class="one"><span class="need">*</span>研究方向</td>
						<td class="two"><input type="text" value="计算机操作系统"></td>
						<td class="one">所属院系<span class="need">*</span></td>
						<td class="two"><input type="text" value="电信学院"></td>
					</tr>
					<tr>
						<td class="one">单位<span class="need">*</span></td>
						<td class="two" colspan="5"><input type="text" value="计算机教学实验中心"></td>
					</tr>
					<tr>
						<td class="one">家庭地址</td>
						<td class="two" colspan="5"><input type="text" value="广东省茂名市茂南区官渡二路139号"></td> 
					</tr>
					<tr>
						<td class="one" rowspan="10" >
							所得奖项
							<div class="home email add_item">
								<svg class="icon" aria-hidden="true">
									<use xlink:href="#icon-icon-test"></use>
								</svg>
							</div>
						</td>
						<td class="three" colspan="3">奖项名称</td>
						<td class="one">级别</td>
						<td class="one">获奖时间</td>
					</tr>
					<tr class="no_company">
						<td colspan="6">无</td>
					</tr>
					<tr>
						<td colspan="3"><input type="text" name="params[teacher][reward_n][]" value="智能机器人研究项目一等奖"></td>
						<td><input type="text" value="国家级" name="params[teacher][type_n][]"></td>
						<td>
							<input type="text"value="2017-09-01" name="params[teacher][time][]" style='width:80px;'>
							<a href='javascript:;' class='home email del' style="display:none;">
								<svg class='icon' style='color:red;' aria-hidden='true'>
									<use xlink:href='#icon-guanbi'></use>
								</svg>
							</a>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<!-- 添加奖项窗口 -->
	<div class="transmit">
		<div class="main">
			<h4>添加奖项</h4>
			<div class="cont_m" style="height:150px;">
				<form action="" id="add_c">
					<table border="1px">
						<tr>
							<td >奖项名称<span class="need">*</span></td>
							<td class="one" colspan="5" style="width:100%;"><input type="text" name="name" value=""></td>
						</tr>
						<tr>
							<td class="one">级别<span class="need">*</span></td>
							<td class="three"><input type="text" name="xy_name" value=""></td>
							<td class="one">获奖时间 <span class="need">*</span></td>
							<td class="three"><input type="text" name="grade" value="" id="datepicker1"></td>
							<td></td>
						</tr>
						<tr>
							<td>操作</td>
							<td class="one" colspan="5" style="width:100%;">
								<div class="add btn_add can">添加</div>
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div class="home close_tran">
				<svg class="icon" aria-hidden="true">
					<use xlink:href="#icon-guanbi"></use>
				</svg>
			</div>
			<span class="tosay"></span>
		</div>
	</div>
	<!-- 回到顶部 -->
	<div class="toTop"><span>↑</span>顶部</div>
	<script type="text/javascript">
	$(function(){
		$(".right input,.right textarea").attr("disabled","false").css("border","none");
		$(".add_item").hide();

		// 点击添加相应的窗口进行显示与影藏
		$(".add_item").click(function(){
			$(".transmit").show();
		})

		// 判断所获奖项是否需要显示“无”这一行
		if($("#com .del").length>0){
			$(".no_company").hide();
		}

		// 点击修改按钮时改变样式
		$(".change").click(function(){
			$("input,textarea").removeAttr("disabled").css("border","1px solid #D8D8D8");
			$(this).hide();
			$(".sure,.del,.add_item").show();
		})
		// 点击确认按钮时改变样式
		$(".sure").click(function(){
			$(".right input,.right textarea").attr("disabled","false").css("border","none");
			$(this).hide();
			$(".change").show();
			$(".del,.add_item").hide();
		})

		// 添加合伙人行函数
 		function add_company(name,input_n,xy_n,xy_v,grade_n,grade_v){
			var tr = "<tr><td colspan='3'><input value="+name+" name='"+input_n+"'></td><td><input type='text' name='"+xy_n+"' value="+xy_v+"/></td><td><input type='text' name='"+grade_n+"' value="+grade_v+" style='width:80px;'/><a href='javascript:;' class='home email del'><svg class='icon' style='color:red;' aria-hidden='true'><use xlink:href='#icon-guanbi'></use></svg></a></td></tr>";
			return tr;
		}

		// 点击添加合伙人进行验证信息
		$(".transmit input").blur(function(){
			if($("#add_c input[name='name']").val()==""){
				$(".tosay").html("用户名不能为空");
				return false;
			}else{
				$(".tosay").html("");
			}
		})	

   		// 添加合伙人
		$(".btn_add").click(function(){
			// 提取表单值
			var d = {};
		    var t = $("#add_c").serializeArray();
		    $.each(t, function() {
		      d[this.name] = this.value;
		    });
		    var name = JSON.stringify(d.name);  //输入的姓名
		    var xy_v = JSON.stringify(d.xy_name);//输入的学院名
		    var grade_v = JSON.stringify(d.grade);//输入的年级名

		    // 添加合伙人
		    $("#com").append(add_company(name,"params[teacher][reward_n][]","params[teacher][type_n][]",xy_v,"params[teacher][time][]",grade_v));

		    // 清除表单
			$("#add_c input[type='text']").val("");

			// 点击删除号删除相应的行
		    $(".del").click(function(){
				$(this).parent().parent("tr").remove();
				if($(".del").length<1){
					$(".no_company").show();
				}
			})
		   
		    // 添加合伙人后影藏弹框并且隐藏“无”一行
		    $(".transmit").hide();
		    if($("#com").find(".no_company").length==1){
		    	$(".no_company").hide();
		    }
		    $("input,textarea").removeAttr("disabled").css("border","1px solid #D8D8D8");
		})
		
		// 点击删除号删除相应的行
	    $(".del").click(function(){
			$(this).parent().parent("tr").remove();
			if($(".del").length<1){
				$(".no_company").show();
			}
		})

		// 日期调用
		laydate.render({
		  elem: '#datepicker' //指定元素
		});
		// 日期调用
		laydate.render({
		  elem: '#datepicker1' //指定元素
		});
	})
	</script>
</body>
</html>